import express from 'express';
import { createApiToken, verifyToken, getCurrentToken } from '../controllers/token.controller';

const router = express.Router();

// 创建 token 接口
router.post('/createApiToken', createApiToken);

// 获取当前 token 接口
router.get('/currentToken', (req, res) => {
  res.json({
    code: 0,
    message: '操作成功',
    data: {
      token: getCurrentToken()
    }
  });
});

// 需要 token 验证的接口
router.use(verifyToken);

export default router; 